#include "BulletCollision/CollisionShapes/btMiniSDF.h"
#ifdef __cplusplus
extern "C" {
#endif
btShapeMatrix* bullet_NewbtShapeMatrix(){
	btShapeMatrix* wrap_out = new btShapeMatrix();
	return wrap_out;
}

double** bullet_btShapeMatrix_GetFieldOfM_vec(btShapeMatrix* c_this){
	return (double**)(&c_this->m_vec);
}

btShapeGradients* bullet_NewbtShapeGradients(){
	btShapeGradients* wrap_out = new btShapeGradients();
	return wrap_out;
}

void bullet_btShapeGradients_bottomRowsMul(btShapeGradients* c_this,int row,double val){
	int c_arg_row=row;
	double c_arg_val=val;
	c_this->bottomRowsMul(c_arg_row,c_arg_val);
}

btVector3** bullet_btShapeGradients_GetFieldOfM_vec(btShapeGradients* c_this){
	return (btVector3**)(&c_this->m_vec);
}

void bullet_btShapeGradients_topRowsDivide(btShapeGradients* c_this,int row,double denom){
	int c_arg_row=row;
	double c_arg_denom=denom;
	c_this->topRowsDivide(c_arg_row,c_arg_denom);
}

btMultiIndex* bullet_NewbtMultiIndex(){
	btMultiIndex* wrap_out = new btMultiIndex();
	return wrap_out;
}

unsigned int** bullet_btMultiIndex_GetFieldOfIjk(btMultiIndex* c_this){
	return (unsigned int**)(&c_this->ijk);
}

btMiniSDF* bullet_NewbtMiniSDF(){
	btMiniSDF* wrap_out = new btMiniSDF();
	return wrap_out;
}

btVector3* bullet_btMiniSDF_GetFieldOfM_cell_size(btMiniSDF* c_this){
	return (btVector3*)(&c_this->m_cell_size);
}

btAlignedBox3d* bullet_btMiniSDF_GetFieldOfM_domain(btMiniSDF* c_this){
	return (btAlignedBox3d*)(&c_this->m_domain);
}

btVector3* bullet_btMiniSDF_GetFieldOfM_inv_cell_size(btMiniSDF* c_this){
	return (btVector3*)(&c_this->m_inv_cell_size);
}

bool bullet_btMiniSDF_GetFieldOfM_isValid(btMiniSDF* c_this){
	return (bool)(c_this->m_isValid);
}

unsigned long long bullet_btMiniSDF_GetFieldOfM_n_cells(btMiniSDF* c_this){
	return (unsigned long long)(c_this->m_n_cells);
}

unsigned long long bullet_btMiniSDF_GetFieldOfM_n_fields(btMiniSDF* c_this){
	return (unsigned long long)(c_this->m_n_fields);
}

unsigned int** bullet_btMiniSDF_GetFieldOfM_resolution(btMiniSDF* c_this){
	return (unsigned int**)(&c_this->m_resolution);
}

bool bullet_btMiniSDF_interpolate(btMiniSDF* c_this,unsigned int field_id,double* dist,btVector3* x,btVector3* gradient){
	unsigned int c_arg_field_id=field_id;
	double& c_arg_dist=(double&)(*dist);
	btVector3 const& c_arg_x=(btVector3 const&)(*x);
	btVector3 * c_arg_gradient=(btVector3 *)(void*)(gradient);
	bool c_out = c_this->interpolate(c_arg_field_id,c_arg_dist,c_arg_x,c_arg_gradient);
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btMiniSDF_isValid(btMiniSDF* c_this){
	bool c_out = c_this->isValid();
	bool wrap_out = (c_out);
	return wrap_out;
}

bool bullet_btMiniSDF_load(btMiniSDF* c_this,char* data,int size){
	char const * c_arg_data=(char const *)(void*)(data);
	int c_arg_size=size;
	bool c_out = c_this->load(c_arg_data,c_arg_size);
	bool wrap_out = (c_out);
	return wrap_out;
}

unsigned int bullet_btMiniSDF_multiToSingleIndex(btMiniSDF* c_this,btMultiIndex* ijk){
	btMultiIndex const& c_arg_ijk=(btMultiIndex const&)(*ijk);
	unsigned int c_out = c_this->multiToSingleIndex(c_arg_ijk);
	unsigned int wrap_out = (c_out);
	return wrap_out;
}

btShapeMatrix* bullet_btMiniSDF_shape_function_(btMiniSDF* c_this,btVector3* xi,btShapeGradients* gradient){
	btVector3 const& c_arg_xi=(btVector3 const&)(*xi);
	btShapeGradients * c_arg_gradient=(btShapeGradients *)(void*)(gradient);
	btShapeMatrix c_out = c_this->shape_function_(c_arg_xi,c_arg_gradient);
	btShapeMatrix* wrap_out = new btShapeMatrix(c_out);
	return wrap_out;
}

btMultiIndex* bullet_btMiniSDF_singleToMultiIndex(btMiniSDF* c_this,unsigned int l){
	unsigned int c_arg_l=l;
	btMultiIndex c_out = c_this->singleToMultiIndex(c_arg_l);
	btMultiIndex* wrap_out = new btMultiIndex(c_out);
	return wrap_out;
}

btAlignedBox3d* bullet_btMiniSDF_subdomain(btMiniSDF* c_this,btMultiIndex* ijk){
	btMultiIndex const& c_arg_ijk=(btMultiIndex const&)(*ijk);
	btAlignedBox3d c_out = c_this->subdomain(c_arg_ijk);
	btAlignedBox3d* wrap_out = new btAlignedBox3d(c_out);
	return wrap_out;
}

btAlignedBox3d* bullet_btMiniSDF_subdomain1(btMiniSDF* c_this,unsigned int l){
	unsigned int c_arg_l=l;
	btAlignedBox3d c_out = c_this->subdomain(c_arg_l);
	btAlignedBox3d* wrap_out = new btAlignedBox3d(c_out);
	return wrap_out;
}

btCell32* bullet_NewbtCell32(){
	btCell32* wrap_out = new btCell32();
	return wrap_out;
}

unsigned int** bullet_btCell32_GetFieldOfM_cells(btCell32* c_this){
	return (unsigned int**)(&c_this->m_cells);
}

btAlignedBox3d* bullet_NewbtAlignedBox3d(btVector3* mn,btVector3* mx){
	btVector3 const& c_arg_mn=(btVector3 const&)(*mn);
	btVector3 const& c_arg_mx=(btVector3 const&)(*mx);
	btAlignedBox3d* wrap_out = new btAlignedBox3d(c_arg_mn,c_arg_mx);
	return wrap_out;
}

btAlignedBox3d* bullet_NewbtAlignedBox3d1(){
	btAlignedBox3d* wrap_out = new btAlignedBox3d();
	return wrap_out;
}

bool bullet_btAlignedBox3d_contains(btAlignedBox3d* c_this,btVector3* x){
	btVector3 const& c_arg_x=(btVector3 const&)(*x);
	bool c_out = c_this->contains(c_arg_x);
	bool wrap_out = (c_out);
	return wrap_out;
}

btVector3* bullet_btAlignedBox3d_GetFieldOfM_max(btAlignedBox3d* c_this){
	return (btVector3*)(&c_this->m_max);
}

btVector3* bullet_btAlignedBox3d_GetFieldOfM_min(btAlignedBox3d* c_this){
	return (btVector3*)(&c_this->m_min);
}

btVector3* bullet_btAlignedBox3d_max(btAlignedBox3d* c_this){
	btVector3 const& c_out = c_this->max();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

btVector3* bullet_btAlignedBox3d_min(btAlignedBox3d* c_this){
	btVector3 const& c_out = c_this->min();
	btVector3* wrap_out = (btVector3*)(&c_out);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
